home *** CD-ROM | disk | FTP | other *** search
/ CD Exchange / CD Exchange - Volume 1.iso / d.t.p / utils / propage / donsgenies / donsgenies.lha / Don'sGenies / PrintPageUsingPost.pprx < prev    next >
Text File  |  1993-05-25  |  3KB  |  58 lines

  1. /* This genie uses the public domain Postscript interpreter "Post" to print the current page. The advantages are that you can print .eps files on a non-Postscript printer and that you can use real Type 1 fonts, rather than converted versions.  The files "post" and "init.ps" should be in a drawer called "post" in your "PPage:" drawer (if not, modify the indicated line in the genie), the necessary .psfont files in CGFonts:ps, and "post.library" in libs:  You do NOT need "Conman". 
  2. Make sure the assigns for PPage: and CGFonts: are set up in your startup-sequence or user-startup files. 
  3. It is also essential to set the Limits in your printer graphics preferences to the correct page size in pixels i.e. the printer's dots-per-inch * page size in inches. Typical figures are 1500 by 2100. */
  4. /* Note: There is a bug in Post which means that it will refuse to print colour bitmaps on colour printers under WB 2.04. It seems to be OK under WB 1.3. 
  5. Also, gradient fills do not work in colour. Colour separations and B&W are OK. 
  6. Versions of Post older than 1.7 have problems with files from Quark XPress and Freehand.
  7. There is also a bug in ProDraw which results in its printing incorrectly when page sizes are set in pixels.
  8. */
  9. /* Written by Don Cox. Copyright. Not Public Domain. All rights reserved. */
  10.  
  11. trace n
  12. signal on error
  13. signal on syntax
  14. address command
  15. call SafeEndEdit.rexx()
  16. call ppm_AutoUpdate(0)
  17. cr="0a"x
  18.  
  19. thispage = ppm_CurrentPage()
  20. oldoutput = ppm_GetPSOutput()
  21. call ppm_SetPSFontDownload(0)
  22. call ppm_SetPSOutput("PPage:temp.ps")
  23. success = ppm_PrintPagePS(thispage,1,1)
  24. if success ~=1 then exit_msg("Failed saving temporary Postscript file.")
  25.  
  26. /* Set up a text file in ram: and then send it to a temporary command window */
  27. conwindow = "CON:40/40/500/200/NewWindow"
  28. call open out, "ram:temp", write  /* This wipes out any existing ram:temp  */
  29. call writeln out, "cd PPage:Post" /* post is in drawer "Post" in "PPage:" - if not, change this line  */
  30. call writeln out, "post init.ps PPage:temp.ps" /* To use lots of fonts in one document, add memory to Post here. See Post documentation. */
  31. call writeln out, "delete PPage:temp.ps"
  32. call writeln out, "endcli"  /* if you have problems, comment this line out so the CLI stays on screen with Post error mesages */
  33. call close out
  34. "newcli" conwindow "ram:temp" /* open a CLI and use ram:temp as a set of commands */
  35.  
  36. call ppm_SetPSOutput(oldoutput)
  37. call exit_msg()
  38.  
  39. end
  40.  
  41. error:
  42. syntax:
  43.     do
  44.     exit_msg("Genie failed due to error: "errortext(rc))
  45.     end
  46.  
  47. exit_msg:
  48.     do
  49.     parse arg message
  50.     if message ~= "" then
  51.     call ppm_Inform(1,message)
  52.     call ppm_ClearStatus()
  53.     call ppm_PPageToFront()
  54.     call ppm_AutoUpdate(1)
  55.     exit
  56.     end
  57.  
  58.